<?php

class Application_Model_FormLogin extends Zend_Form {

    public function __construct($options = null) {
        parent::__construct($options);
        $this->setName('login');
        $this->setMethod('post');
        $this->setAction($options['action']);

        $username = new Zend_Form_Element_Text('username');
        $username->setAttrib('size', 20)
                ->removeDecorator('label')
                ->removeDecorator('htmlTag')
                ->setAttrib('placeholder', 'Your Login here')
                ->setRequired(true)
                ->addErrorMessage('Who are you?');



        $password = new Zend_Form_Element_Password('password');
        $password->setAttrib('size', 20)
                ->removeDecorator('label')
                ->removeDecorator('htmlTag')
                ->setAttrib('placeholder', 'Your Password here')
                ->setRequired(true)
                ->addErrorMessage('Please give me your secret');



        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Login');
        $submit->removeDecorator('DtDdWrapper');

        $this->setDecorators(array(array('Viewscript', array('viewScript' => '_form_login.phtml'))));

        $this->addElements(array($username, $password, $submit));
    }

}

